FROM alpine:latest
ENV FRP_VERSION=0.54.0
RUN cd /root &&\
    apk add --no-cache curl wget tar sed &&\
    wget --no-check-certificate -c https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz &&\
    tar zxvf frp_${FRP_VERSION}_linux_amd64.tar.gz &&\
    cd frp_${FRP_VERSION}_linux_amd64/ &&\
    mkdir /frpc &&\
    cp frpc /usr/bin/ &&\
    cp frpc.toml /frpc &&\
    wget --no-check-certificate -P /frpc/ https://gitee.com/yujibuzailai8/frpc/raw/master/entrypoint &&\
    cd /root &&\
    rm frp_${FRP_VERSION}_linux_amd64.tar.gz &&\
    rm -rf frp_${FRP_VERSION}_linux_amd64/ &&\
    chmod +x /frpc/entrypoint
WORKDIR /frpc
ENTRYPOINT ["/bin/sh" "-c" "/frpc/entrypoint"]